const requireEx=require('yi-require');
const lookup = require('yi-lookup');

// const beforeSend = function (req,body,callback) {
//     let dataList = (body.data instanceof Array) ? body.data : body.data.items;
//     let lookupList = [];
//     lookupList.push({
//         from: "mall",
//         localField: "mallId",
//         foreignField: "_id",
//         project:{createTime:0,lastModifyDate:0}
//     });
//     lookup.lookup(req.mongo, dataList, lookupList, (e, r) => {
//         callback(null, body);
//     });
// };

const middleware =(req, res, next)=>{
//    req.beforeSend = beforeSend;
    next();
};

module.exports = {
    middleware:middleware,
    description:'获取商铺类型',
    handler: requireEx('yi-restful').r('storeClass')
};
